home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / libtools.arc / SQ-USQ.DOC < prev    next >
Encoding:
Text File  |  1984-03-18  |  5.5 KB  |  136 lines

  1. SQUEEZE/UNSQUEEZE   File compression routines.         March 15, 1984
  2.                               (SQPC161, USQLC10)
  3.  
  4. The squeeze/unsqueeze programs were originally deveolped for CP/M by
  5. Richard Greenlaw.  The squeeze program runs a data or program file through
  6. a rather complicated compression routine to produce a new file which is
  7. usually considerably smaller but can be used by the unsqueeze program to
  8. reproduce the original file, exactly.  The compression routines uses the
  9. Huffman algorithm which represents frequently occurring characters with
  10. fewer bits.  It is not necessary to know the internal details to use
  11. these programs.
  12.  
  13. Files found on bulletin boards and user libraries are often squeezed to
  14. conserve file space and reduce transmission time.  The exact percentage
  15. of compression depends on the data in the file, with documentation files
  16. ususally squeezing best.
  17.  
  18. Initial translations of the program to the IBM PC were slow, and did not
  19. work in all cases.  The current versions (SQPC161.EXE and USQLC10.COM)
  20. were translated as closely as possible from the CP/M versions, and work
  21. in all cases identically to the CP/M versions.    USQLC10 includes an
  22. error checking function, and will usually detect a file which was squeezed
  23. incorrectly by an older version of sq.com.
  24.  
  25. As a result of returning to the CP/M versions, some of the PC specific
  26. amenities (such as redirecting output to con:) were removed -- accuracy
  27. first!    A future version will put them back.
  28.  
  29. I suggest that you rename the files to SQ and USQ on your working copy, the
  30. version suffix is just so you'll recognize the new versions as they appear.
  31. The documentation always refers to them as SQ and USQ.
  32.  
  33.  
  34.                     Alan Losoff
  35.                     Milwaukee, Wisconsin
  36.  
  37.  
  38.  
  39.  
  40.  
  41. SQUEEZE/UNSQUEEZE     Squeezing Files                  page 2
  42. (SQPC161.EXE)                          March 15, 1984
  43.  
  44.  
  45. The squeeze program squeezes a file and produces a new output file with
  46. the 2nd letter of the file extension changed to "Q".  For example
  47.  
  48.     SQ  THING.BAS
  49.  
  50. creates a new file called THING.BQS.  The original filename is preserved as
  51. part of the squeezed file, as is all the information needed to recreate it.
  52. The ouput is to the default drive (in the DOS > prompt).
  53.  
  54. The output filename may not be varied, but an output drive may be specified.
  55. Thus
  56.     SQ  B:     THING.BAS
  57.  
  58. creates THING.BQS on drive B.  It reads the input from the default drive if
  59. no drive is specified on the file itself.  If THING.BQS already exists, it
  60. is overwritten.
  61.  
  62. Several filenames/drives may be specified on one command line.    They
  63. are processed in order.  Thus
  64.  
  65.     SQ  THING.BAS  WHAT.ASM  B:  WHO.DOC  A:  B:WHICH.ASM
  66.  
  67. squeezes THING.BAS and WHAT.ASM from the default drive to THING.BQS and
  68. WHAT.AQM on the same drive, then squeezes WHO.DOC from the default drive
  69. to WHO.DQC on drive b, and finally squeezes WHICH.ASM from drive b to
  70. WHICH.AQM on the default drive.
  71.  
  72.  
  73. If no parameters are given on the command line, SQ prompts for filenames
  74. (or drives) one at a time from the keyboard.  This allows you to enter
  75. filenames and drives after removing the disk containing SQ.  Also, using
  76. MSDOS redirection, you can enter filenames via a file or pipeline.
  77.  
  78. Restrictions:
  79.     The current version will only funtion with MSDOS 2.0 or higher, but
  80. paths are not supported.
  81.  
  82.  
  83.  
  84.  
  85.  
  86. SQUEEZE/UNSQUEEZE     Unqueezing Files                  page 3
  87. (USQLC10.COM)                          March 15, 1984
  88.  
  89.  
  90. The purpose of this program is to unsqueeze files created by SQ.COM,
  91. restoring them to their original condition.  This is a fast C version
  92. compiled with Lattice C.  It runs over 5 times as fast as the Pascal
  93. version on most IBM boards.  It also has error checking to detect files
  94. which were improperly squeezed by an old version of SQ.
  95.  
  96. You may specify as many input files on a command line as fit, the output
  97. filename is reconstructed from the squeezed data.  Output is to the
  98. default drive and path, but the drive may be changed by including a
  99. drive specification with no filename.  Path cannot be altered.
  100.  
  101. For example (assuming you have renamed it to USQ.COM)
  102.  
  103.     USQ  PROG1.CQM  B:PROG2.CQM  B:  PROG3.DQC
  104.  
  105. will unsqueeze prog1 and prog2 (from drive b:) to the default drive and
  106. prog3 to drive b:.  The new files will have the original name, most
  107. likely prog1.com, prog2.com and prog3.doc in this case.  If you already
  108. have a file by that name, it will be overwritten.
  109.  
  110. Two error messages are possible, UNEXPECTED EOF or CRC ERROR.  In either
  111. case some error has crept in due to copying or transmission, or
  112. the file was not properly squeezed in the first place. The resulting file
  113. is most likely unusable.  WARNING -- older versions of USQ do not check
  114. CRC, and may appear to unsqueeze a file correctly even if not.
  115.  
  116. Make sure you have enough disk space to handle the output file which could
  117. be over twice the size of the input file.  It is best to target your output
  118. to a blank diskette (or a temporary directory), since the output file name
  119. will be the name of the file originally squeezed, and may not be the name
  120. you expect.  (I clobbered a good file once, when I unsqueezed a program
  121. named BOB.DQC and the output file was MANUAL.DOC).  Future versions will
  122. give you the option of changing the ouput name.
  123.  
  124. Restrictions:
  125.      This program should work in version 1.1 or higher of MSDOS or PCDOS.
  126. It does not handle pathnames.
  127.  
  128.  
  129.  
  130. of returning to the CP/M versions, some of the PC specific
  131. amenities (such as redirecting output to con:) werehnames.
  132.  
  133.  
  134.  
  135. of returning to the CP/M versions, some of the PC specific
  136. amenities (such as redirecting output to con:) were